
import { createBrowserRouter } from "react-router-dom";
import Home from "../pages/Home";
import Login from "../pages/Login";
import Layout from "../pages/layout";
import Age from "../pages/age";
import Name from "../pages/name";
import NotFind from "../pages/notFind";
 
const router = createBrowserRouter([
    {
     path:'/',
     element: <Layout />,
     children:[
        {
            // path:'age',
            index:true, //默认二级路由
            element: <Age />,
        },
        {
          path:'name',
          element: <Name />,
        },

     ]
    },
    {
        path:'/home',
        element: <Home />,
    },
    {
        path:'/login',
        element: <Login />,
    },
    {
     path:'*',
     element:<NotFind></NotFind>
    }
])
 
export default router
